package com.yzt.zhuju.dialog;

import android.view.View;
import android.widget.TextView;

import com.yzt.zhuju.R;

/**
 * author : bob
 * date   : 2023/2/28
 * desc   :
 */
public class DynamicSelectDialog extends BottomBaseDialog {

    @Override
    public int getLayoutRes() {
        return R.layout.dialog_dynamic_select;
    }

    @Override
    public void bindView(View v) {
        TextView tv_video = findViewById(R.id.tv_video);
        TextView tv_pic = findViewById(R.id.tv_pic);

        tv_video.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (listener != null) {
                    listener.onSelectVideo();
                }
                dismissAllowingStateLoss();
            }
        });

        tv_pic.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (listener != null) {
                    listener.onSelectPic();
                }
                dismissAllowingStateLoss();
            }
        });
    }

    private OnSelectOnClickListener listener;

    public void setListener(OnSelectOnClickListener listener) {
        this.listener = listener;
    }

    public interface OnSelectOnClickListener {

        void onSelectVideo();

        void onSelectPic();
    }
}
